package com.atguigu01.create.exer2;

/**
 * ClassName: Exer_1
 * Package: com.atguigu01.create.exer2
 * Description:
 *
 * @Author ZY
 * @Create 14:59
 * @Version 1.0
 */

//      "Thread.run()优先走，若有重写不回头；没重写时找Runnable，两者全无空执行。"
public class Exer_1 {
    public static void main(String[] args) {
        //情况一：重写了run():CC
//        BB b = new BB();
//        new Thread(b){
//            @Override
//            public void run() {
//                System.out.println("CC");
//            }
//        }.start();

        //情况一：没有重写run():BB
        BB b = new BB();
        new Thread(b){
//            @Override
//            public void run() {
//                System.out.println("CC");
//            }
        }.start();
    }
}


class AA extends Thread{
    @Override
    public void run() {
        System.out.println("AA");
    }
}

class BB implements Runnable{
    @Override
    public void run() {
        System.out.println("BB");
    }
}